<template>
	<view class="btn-index">
		<view class="search-box" @click="jump()">
			<i class="iconfont fontclassIcon_Search"></i>
			{{Type==0?inputtitle:inputtitle2}}
		</view>
		<view class="image-box" v-if="Type==0">
			<image src="../../../static/index/qunliao.png" mode=""></image>
			<text @click="addGrop()">加群聊</text>
		</view>
	</view>

</template>

<script>
	import * as index from '@/api/index.js'
	export default {
		props:{
			Type:Number
		},
		data() {
			return {
				inputtitle: '搜索需求/公司',
				inputtitle2: '搜索接单/牛人',
			}
		},
		watch: {
		},
		mounted() {
		},
		methods: {
			btnnavto() {
			},
			jump(){
				this.$tools.navigate('/pages/home/searchWork/index')
			},
			addGrop(){
				index.nameGetConfig({name:'add_group'}).then(res=>{
					console.log(res.data.add_group);
					let that = this
					uni.setStorage({
						key: 'link',
						data: res.data.add_group,
						success: function () {
							that.$tools.navigate('/pages/home/webView/index')
						}
					});
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.btn-index {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 28rpx 20rpx;
		.search-box{
			display: flex;
			align-items: center;
			text-align: left;
			padding-left: 45rpx;
			background: #ffffff;
			height: 66rpx;
			line-height: 66rpx;
			border-radius: 66rpx;
			width: 100%;
			margin-right:20rpx;
			font-size: 28rpx;
			font-weight: 400;
			color: #9D9A9A;
		}
		.image-box{
			display: flex;
			align-items: center;
			flex-shrink: 0;
			padding: 0 17rpx;
			line-height: 66rpx;
			background: #FF7700;
			height: 66rpx;
			border-radius: 66rpx;
			color: #ffffff;
			image{
				width: 40rpx;
				height: 40rpx;
			}
		}
	}
</style>
